package org.luo.iot.domain.device;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface DeviceMapper extends BaseMapper<Device> {
    void updatePriceByIds(@Param("ew") QueryWrapper<Device> wrapper, @Param("amount") int amount);

    @Update("update device set price = price - #{price} where id = #{id}")
    void deductPrice(int id, int price);
}
